package com.xy.biz.ts.domain.bo;

import com.xy.biz.ts.domain.req.SaveExaminationPaperRuleRequest;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

/**
 *
 *
 * @author wcs
 * @date 2021-3-8
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class ExaminationPaperBO {
    public ExaminationPaperBO(ExaminationPaperBO examinationPaperBO) {
        this.examinationPaperId = examinationPaperBO.getExaminationPaperId();
        this.trainId = examinationPaperBO.getTrainId();
        this.trainName = examinationPaperBO.getTrainName();
        this.examinationPaperName = examinationPaperBO.getExaminationPaperName();
        this.category = examinationPaperBO.getCategory();
        this.type = examinationPaperBO.getType();
        this.totalScore = examinationPaperBO.getTotalScore();
        this.passScore = examinationPaperBO.getPassScore();
        this.duration = examinationPaperBO.getDuration();
        this.status = examinationPaperBO.getStatus();
        this.cover = examinationPaperBO.getCover();
        this.numberOfExamsAllowed = examinationPaperBO.getNumberOfExamsAllowed();
        this.tenantId = examinationPaperBO.getTenantId();
        this.createUserId = examinationPaperBO.getCreateUserId();
        this.createTime = examinationPaperBO.getCreateTime();
        this.updateTime = examinationPaperBO.getUpdateTime();
        this.questionCategory = examinationPaperBO.getQuestionCategory();
        this.questionType = examinationPaperBO.getQuestionType();
        this.difficulty = examinationPaperBO.getDifficulty();
        this.count = examinationPaperBO.getCount();
        this.score = examinationPaperBO.getScore();
        this.deleteFlag = examinationPaperBO.getDeleteFlag();
    }

    /**
     * 试卷Id
     */
    private Long examinationPaperId;
    /**
     * 培训Id
     */
    private Long trainId;
    /**
     * 培训名称
     */
    private String trainName;
    /**
     * 试卷名称
     */
    private String examinationPaperName;
    /**
     * 试卷分类
     */
    private String category;
    /**
     * 试卷类型：0-固定试卷，1-随机试卷
     */
    private Integer type;
    /**
     * 总分
     */
    private Integer totalScore;
    /**
     * 通过分数
     */
    private Integer passScore;
    /**
     * 考试时长（分）
     */
    private Integer duration;
    /**
     * 状态：0-停用，1-启用
     */
    private Integer status;
    /**
     * 封面
     */
    private String cover;
    /**
     * 允许考试次数
     */
    private Integer numberOfExamsAllowed;
    /**
     * 当前用户已考试次数
     */
    private Integer currentUserNumberOfExamsAllowed;
    /**
     * 租户Id，0表示不指定
     */
    private Long tenantId;
    /**
     * 创建人Id
     */
    private Long createUserId;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    private LocalDateTime updateTime;


    /**
     * 题库分类
     */
    @NotBlank
    @Length(max = 20)
    private String questionCategory;
    /**
     * 试题类型：0-未定义，1-单选题，2-多选题，3-判断题，4-填空题，5-简答题
     */
    @NotNull
    @Max(127)
    private Integer questionType;
    /**
     * 难度：0-未定义，1-容易、2-常规、3-较难、4-很难
     */
    @NotNull
    @Max(127)
    private Integer difficulty;
    /**
     * 题数
     */
    @NotNull
    private Integer count;
    /**
     * 分数
     */
    @NotNull
    private Integer score;
    /**
     * 删除标识：0-正常，1-删除
     */
    private Boolean deleteFlag;

}
